2004-11-06 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
+ Don't support CREATE_FOLDER and SAVE for now. UI authorities
+ object to it. (#157384, Seth Nickell)
+
* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
a few hoops to make the tooltip on the filter combo box work
a bit better. This fixes #157273 and #157074.
2004-11-06 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
+ Don't support CREATE_FOLDER and SAVE for now. UI authorities
+ object to it. (#157384, Seth Nickell)
+
* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
a few hoops to make the tooltip on the filter combo box work
a bit better. This fixes #157273 and #157074.
2004-11-06 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
+ Don't support CREATE_FOLDER and SAVE for now. UI authorities
+ object to it. (#157384, Seth Nickell)
+
* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
a few hoops to make the tooltip on the filter combo box work
a bit better. This fixes #157273 and #157074.
2004-11-06 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
+ Don't support CREATE_FOLDER and SAVE for now. UI authorities
+ object to it. (#157384, Seth Nickell)
+
* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
a few hoops to make the tooltip on the filter combo box work
a bit better. This fixes #157273 and #157074.
</example>
<para>
-The #GtkFileChooserButton supports all four #GtkFileChooserAction<!--
--->s that the #GtkFileChooser supports. Two of the actions,
-%GTK_FILE_CHOOSER_ACTION_SAVE and
-%GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, give the button the appearance
-of an entry next to a button. The user can type the name of a file in
-this entry, and it will complete as it types. The other two actions,
-%GTK_FILE_CHOOSER_ACTION_OPEN and
-%GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, make the #GtkFileChooserAction
-look like a #GtkButton.
+The #GtkFileChooserButton supports the #GtkFileChooserAction<!--
+-->s %GTK_FILE_CHOOSER_ACTION_OPEN and %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
</para>
-<example>
-<title>Using GtkFileChooserButton in save mode</title>
-<programlisting>
-{
- GtkWidget *button;
-
- button = gtk_file_chooser_button_new (_("Save as..."));
- gtk_file_chooser_set_action (GTK_FILE_CHOOSER (button),
- GTK_FILE_CHOOSER_ACTION_SAVE);
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER_BUTTON (button),
- DEFAULT_SAVE_DIRECTORY);
-}
-</programlisting>
-</example>
-
<important>
<para>
-The #GtkFileChooserButton will ellipsize the label while in Open mode,
+The #GtkFileChooserButton will ellipsize the label,
and thus will thus request little horizontal space. To give the button
more space, you should call gtk_widget_size_request(),
gtk_file_chooser_button_set_width_chars(), or pack the button in
break;
case GTK_FILE_CHOOSER_PROP_ACTION:
+ switch (g_value_get_enum (value))
+ {
+ case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
+ case GTK_FILE_CHOOSER_ACTION_SAVE:
+ {
+ GEnumClass *eclass;
+ GEnumValue *eval;
+
+ eclass = g_type_class_peek (GTK_TYPE_FILE_CHOOSER_ACTION);
+ eval = g_enum_get_value (eclass, g_value_get_enum (value));
+ g_warning ("%s: Choosers of type `%s` do not support `%s'.",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), eval->value_name);
+
+ g_value_set_enum (value, GTK_FILE_CHOOSER_ACTION_OPEN);
+ }
+ break;
+ }
+
g_object_set_property (G_OBJECT (priv->dialog), pspec->name, value);
_gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (priv->entry),
(GtkFileChooserAction) g_value_get_enum (value));